bsdkm: misc cleanup.#10546
Conversation
There was a problem hiding this comment.
Pull request overview
Minor cleanup of the FreeBSD kernel module (bsdkm) port: make XMALLOC choose its wait flag based on whether the caller is in a critical section, consolidate error/cleanup paths in wolfkmod_load() and wolfkdriv_attach() so failures don't leak resources to analyzers, and tidy up some comments and macros.
Changes:
bsdkm_wc_port.h: include<sys/proc.h>and chooseM_WAITOK/M_NOWAITforXMALLOCbased oncurthread->td_critnest; debugXFREEprints the captured pointer_xp.wolfkmod.c: singlewolfkmod_load_outcleanup path forwolfkmod_load(); routewolfkmod_init()andcrypto_get_driverid()failures throughattach_out, which now also callswolfkmod_cleanup()on error (and no longer overwriteserrorwithENXIO).x86_vecreg.c: comment-only clarifications.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bsdkm/bsdkm_wc_port.h | Context-sensitive malloc wait flag; minor debug XFREE print fix. |
| bsdkm/wolfkmod.c | Consolidated error-handling in wolfkmod_load and wolfkdriv_attach. |
| bsdkm/x86_vecreg.c | Comment cleanup for fpu state struct and fpu_states array. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Retest this please. |
JacobBarthelmeh
left a comment
There was a problem hiding this comment.
@douzzer please review.
douzzer
left a comment
There was a problem hiding this comment.
very nice tweak to malloc() flags -- that's a current hot spot in Linux kernel too (upstream and for us).
Description
Some bsdkm cleanup:
malloc()M_NOWAITin critical section, andM_WAITOKotherwise..Fixes several Fenrir issues.